﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using iMainAddin;

using EnvDTE;

namespace iProjectAddin
{
    public partial class iVCForm : Form
    {
        protected static String formType = iForm.AddCreateFormFunction("iVCProjectForm", new iMainAddin.CreateFormFunction(iVCForm.CreateFunction));
        public iVCForm()
        {
            InitializeComponent();
        }
        ~iVCForm()
        {
        }
        private void ButtonOK_Click(object sender, EventArgs e)
        {
            CreateProject();

            Close();
        }

        private void ButtonCancle_Click(object sender, EventArgs e)
        {
            Close();
        }
        public static Form CreateFunction()
        {
            return new iVCForm();
        }

        //private void OnKeyUp(object sender, KeyEventArgs e)
        //{
        //    switch(e.KeyCode)
        //    {
        //        case Keys.Enter:
        //            CreateProject();
        //            break;
        //        case Keys.Tab:
        //            ChangeCheckBox();
        //            break;
        //    }
        //}

        private void CreateProject()
        {
            if (EngineModlue.Checked)
            {
                iVcModuleProject projEngine = new iVcModuleProject();
                bool ret = projEngine.Create(ProjectNameBox.Text);
            }
            else if (GameSample.Checked)
            {
                iVCSampleProject projEngine = new iVCSampleProject();
                bool ret = projEngine.Create(ProjectNameBox.Text);
            }
        }

        private void ChangeCheckBox()
        {
            if(EngineModlue.Checked)
                GameSample.Checked = true;
            else
                EngineModlue.Checked = true;
        }
    }
}
